﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Themes/Main.master" AutoEventWireup="true" CodeBehind="RoleList.aspx.cs" Inherits="TrainingsApp.IPADApp.Permission.RoleList" %>

<%@ Register assembly="TrainingsApp.Controls" namespace="TrainingsApp.Controls.GridViewExt" tagprefix="GridViewExt" %>
<%@ Register assembly="TrainingsApp.Controls" namespace="TrainingsApp.Controls.TextControlExt" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../Scripts/Dialog.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        function edit(id) {
            return openChildDialog('功能修改', 'RoleEdit.aspx?ActionCode=<%=ClientConstSet.Update %>&BizCode=' + id, 650, 300);
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="tablist2" width="100%" cellspacing="1" cellpadding="0">
        <tr>
            <td class="td1">
                角色名称
            </td>
            <td class="td2">
                <cc1:TextControlExt ID="Name" runat="server"></cc1:TextControlExt>
            </td>
        </tr>
        <tr>
            <td colspan="4" class="td3">
                <asp:Button ID="btnSelect" runat="server" Text="查询" OnClick="btnSelect_Click" class="search"
                    onmouseout="this.className='search'" onmouseover="this.className='search_hover'" ClientIDMode="Static" />
                <asp:Button ID="btnAdd" runat="server" Text="添加" class="add" onmouseout="this.className='add'"
                    onmouseover="this.className='add_hover'" />
            </td>
        </tr>
    </table>
    <GridViewExt:GridViewExt ID="GridView" runat="server" Width="100%" AutoGenerateColumns="False"
        CssClass="table" OnRowCommand="GridView_RowCommand" ShowHeaderWhenEmpty="true"
        OnBindData="GridView_BindData">
        <Columns>
            <asp:TemplateField HeaderText="序号">
                <ItemTemplate>
                            <%# Container.DataItemIndex + 1 + (GridView.PageIndex - 1) * GridView.PageSize%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="角色名称" DataField="RoleName" />
            <asp:BoundField HeaderText="角色描述" DataField="Description" />
            <asp:TemplateField HeaderText="操作">
                <ItemTemplate>
                    <asp:LinkButton ID="lbtEdit" runat="server" CommandName="ed" Text="编辑" OnClientClick=<%# String.Format("return edit('{0}')",Eval("ID")) %>></asp:LinkButton>
                    <asp:LinkButton ID="lbtDelete" runat="server" OnClientClick="return confirm('您确认要删除吗?');"
                        CommandName="del" Text="删除" CommandArgument='<%# Eval("Id") %>'></asp:LinkButton>
                    <asp:LinkButton ID="lbtPermission" runat="server" CommandName="per" Text="分配权限" PostBackUrl='<%# "~/Permission/RoleFunction.aspx?BizCode="+ Eval("Id") +"&name=" + Server.UrlEncode(Eval("RoleName").ToString()) %>'></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </GridViewExt:GridViewExt>
</asp:Content>
